// 将SvgIcon和Pagination引入到插件，
// 然后main.ts中注册此插件，
// 即可将SvgIcon和Pagination注册为全局组件
// 1、阿里图标库注册为全局组件
import SvgIcon from './SvgIcon/index.vue'
// 2、分页器注册为全局组件
import Pagination from './Pagination/index.vue'
// 3、将element-plus.icon注册为全局组件:引入
import * as ElementPlusIconsVue from '@element-plus/icons-vue'

import type { App, Component } from 'vue'
const components: { [name: string]: Component } = { SvgIcon, Pagination }
export default {
  install(app: App) {
    Object.keys(components).forEach((key: string) => {
      app.component(key, components[key])
    })
    // 3、将element-plus提供图标注册为全局组件
    for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
      app.component(key, component)
    }
  },
}
